<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>列表</title>
</head>
<body>
<h1>列表页面</h1>

<button id="add" >新增</button>
<br>
<button id="logout">注销</button>
<hr>
<table border="1" cellspacing="0" width="800">
    <tr>
        <th>序号</th>
        <th>商品名称</th>
        <th>价格</th>
        <th>描述</th>
        <th>操作</th>
    </tr>
   <c:forEach var="good" items="${goods}">
       <tr>
           <td><c:out value="${good.id}" /></td>
           <td><c:out value="${good.name}" /></td>
           <td><c:out value="${good.price}" /></td>
           <td><c:out value="${good.description}" /></td>
           <td>
               <a href="update.jsp?id=<c:out value="${good.id}" />">修改</a>
               <a href="delete?id=<c:out value="${good.id}" />">删除</a>
           </td>
       </tr>
   </c:forEach>

</table>
<script>
    document.getElementById("logout").onclick = function () {
        location.href = "logout";
    }
    document.getElementById("add").onclick = function () {
        location.href = "add.jsp";
    }
</script>
</body>
</html>